" ===================================================================
" Vim Syntax File for Liquid Programming language
" Maintainer: Chris Mueller <christoph.mueller@dfki.de>
" Last Change: 2012 Nov 15
" ===================================================================

if exists("b:current_syntax")
    finish
endif


syn keyword lqKeywords          module mod and or not let def
syn keyword lqStatement         if then else match by fun

syn match   lqOperator          "\(::\|<\|>\|-\|+\|*\|=\|>=\|=<\|++\|--\|&\||\|><\|!\|,\|^\)"
syn match   lqListDelimiter    "\[\|\]"
syn match   lqTupleDelimiter    "(\|)"

syn match   lqAtom              "[A-Z]\([A-Z]\|_\)*[^a-z]"
syn match   lqChar              "\($.\)|\($\\.\)"
syn match   lqNamespace         "\<[A-Za-z_]\+\>:\<[A-Za-z_]\+\>"
syn region  lqString            start=+"+ skip=+\\.+ end=+"+
syn region  lqRawString         start=+'+ skip=+\\.+ end=+'+

syn match   lqNumber		    "\<[0-9]\+\>\|\<0[x][0-9a-fA-F]\+\>\|\<8[x][0-7]\+\>\|\<2[x][0-1]\+\>"
syn match   lqFloat		        "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"

syn match   lqComment           "#.*$" contains=cyTodo
syn keyword lqTodo              TODO FIXME XXX contained


" -------------------------------------------------------------------

hi def link lqKeywords          PreProc
hi def link lqStatement         Statement
hi def link lqOperator          Operator
hi def link lqListDelimiter     Operator
hi def link lqTupleDelimiter    Operator
hi def link lqAtom              Constant
hi def link lqString            String
hi def link lqRawString         Special
hi def link lqComment           Comment
hi def link lqTodo              Todo
hi def link lqChar              Character
hi def link lqNumber            Number
hi def link lqFloat             Float
hi def link lqNamespace         Identifier

let b:current_syntax = "liquid"
